#include "gtest/gtest.h"

//#include "../include/Point.h"
#include "Point.h"
// using SG::Algebra::Point;
// using SG::Algebra::Vector3D;

using namespace SG::Algebra;

TEST (PointTest, TranslateTest)
{
    Point    p0{ 2.0, 2.0, 2.0 };
    Vector3D off{ 0.5, 1.0, 2.0 };
    p0.Translate (off);

    Point PTarget{ 2.5, 3.0, 4.0 };

    // Check
    ASSERT_TRUE (p0 == PTarget);
}

TEST (PointTest, TransformTest)
{
    // Input
    Matrix T (3, 3, { 0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0 });

    Point origin{ 2.0, 2.0, 2.0 };
    Point P0 = { 2.5, 3.0, 4.0 };

    // Test data
    Point::Transform (T, origin, P0, _OUT P0);

    // Target data
    Point PNew{ 1.0, -0.5, 2.0 };

    // Check
    ASSERT_TRUE (P0 == PNew);
}

TEST (PointTest, DistanceFuncTest)
{
    // Input
    Point a{ 2.5, 2.8, 1.1 };
    Point b{ 2.22, -0.23, 0.56 };

    // Test data
    auto distanceTest = Distance (a, b);

    // Target data
    Vector3D distanceTarget{ 0.28, 3.03, 0.54 };

    // Check
    ASSERT_TRUE (distanceTarget == distanceTest);
}